package com.joolun.system.service.impl;

import java.io.Serializable;
import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.joolun.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.joolun.system.mapper.ScrmChannelMapper;
import com.joolun.system.domain.ScrmChannel;
import com.joolun.system.service.IScrmChannelService;

/**
 * 投放渠道Service业务层处理
 * 
 * @author joolun
 * @date 2025-02-25
 */





@Service
public class ScrmChannelServiceImpl extends  ServiceImpl<ScrmChannelMapper, ScrmChannel> implements IScrmChannelService
{
    @Autowired
    private ScrmChannelMapper scrmChannelMapper;

    /**
     * 查询投放渠道
     *
     * @param id 投放渠道主键
     * @return 投放渠道
     */
    @Override
    public ScrmChannel selectScrmChannelById(Long id)
    {
        return scrmChannelMapper.selectScrmChannelById(id);
    }

    /**
     * 查询投放渠道列表
     *
     * @param scrmChannel 投放渠道
     * @return 投放渠道
     */
    @Override
    public List<ScrmChannel> selectScrmChannelList(ScrmChannel scrmChannel)
    {
        return scrmChannelMapper.selectScrmChannelList(scrmChannel);
    }

    /**
     * 新增投放渠道
     *
     * @param scrmChannel 投放渠道
     * @return 结果
     */
    @Override
    public int insertScrmChannel(ScrmChannel scrmChannel)
    {
        scrmChannel.setCreateTime(DateUtils.getNowDate());
        return scrmChannelMapper.insertScrmChannel(scrmChannel);
    }

    /**
     * 修改投放渠道
     *
     * @param scrmChannel 投放渠道
     * @return 结果
     */
    @Override
    public int updateScrmChannel(ScrmChannel scrmChannel)
    {
        scrmChannel.setUpdateTime(DateUtils.getNowDate());
        return scrmChannelMapper.updateScrmChannel(scrmChannel);
    }

    /**
     * 批量删除投放渠道
     *
     * @param ids 需要删除的投放渠道主键
     * @return 结果
     */
    @Override
    public int deleteScrmChannelByIds(Long[] ids)
    {
        return scrmChannelMapper.deleteScrmChannelByIds(ids);
    }

    /**
     * 删除投放渠道信息
     *
     * @param id 投放渠道主键
     * @return 结果
     */
    @Override
    public int deleteScrmChannelById(Long id)
    {
        return scrmChannelMapper.deleteScrmChannelById(id);
    }
}
